clear;clc;
K=100;sigmas=0.2;sigmaj=0.15;r=0.02;T=1.5;t=0;lambda=1;muj=0.13;H=0.7;
a0=80;b0=120;ii=1;jj=1;
for r=0.02:0.005:0.04
 for S=a0:1:b0
     Si=S-a0+1;
    theta=exp(muj+0.5*sigmaj^2)-1;
a=(T^(2*H))*(1/(2*H)-1/(2*H+1)+1/(2*(H+1)));
tao=(lambda*(muj^2+sigmaj^2)*T)/6+H*sigmas^2*a;
kesai=log(S)+(r-lambda*theta+lambda*muj)*T/2+(0.5-H/(2*H+1))*sigmas^2*T^(2*H);
d1=(2*tao+kesai-log(K))/sqrt(2*tao);
d2=(kesai-log(K))/sqrt(2*tao);
Cprice(Si,ii)=exp(tao+kesai-r*T)*normcdf(d1)-K*exp(-r*T)*normcdf(d2);
 end
ii=ii+1;
end
jj=jj+1;
xx=a0:1:b0;
hold on
plot(xx,Cprice(:,1),'r-','Linewidth',1)
plot(xx,Cprice(:,2),'k--','Linewidth',1)
plot(xx,Cprice(:,3),'b+-','Linewidth',1)
plot(xx,Cprice(:,4),'m--','Linewidth',1)
plot(xx,Cprice(:,5),'g-','Linewidth',1)
legend('{\it{r}}=0.020','{\it{r}}=0.025','{\it{r}}=0.030','{\it{r}}=0.035','{\it{r}}=0.040')
xlabel('Underlying Asset Price')
ylabel('Call Option Value')
set(gca,'FontName','Times New Roman','FontSize',12)
box on

